﻿using BussinessObject.ObjectTwo;
using Class_Entity.ObjectTwo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ProjectHK3.App_Code;
namespace ProjectHK3.Object_One
{
    public partial class CreateCity : System.Web.UI.Page
    {
        B_Insert ex = new B_Insert();
        Cities fx = new Cities();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            fx.CITY_CODE = TextBox1.Text;
            fx.CITY_NAME = TextBox2.Text;
            fx.DESCRIPTION = TextBox3.Text;
            if (ex.InsertCity(fx) == true)
            {
                Alert.Show("Insert Sucessful!!!");
                Response.Redirect("../Object One/City.aspx");
            }
            else
            {
                Alert.Show("Insert Fail. Please try again!!!");
            }
        }

        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            TextBox1.Text = "";
            TextBox2.Text = "";
            TextBox3.Text = "";
        }
    }
}